#include <my_header.h>
// 传递8字节数据
/* Usage: ./6_shared_stack4 */
void * threadFunc(void *arg){

    printf("I am child thread \n" );
    //把参数当成是普通的8字节整型
    printf("child, val = %ld\n",(long)arg);
    return NULL;
}
int main(){

    long val = 1001;

    pthread_t tid;
    int ret = pthread_create(&tid,NULL,threadFunc,(void *)val);
    THREAD_ERROR_CHECK(ret,"pthread_create");

    //sleep(1);

    val = 1002;
    ret = pthread_create(&tid,NULL,threadFunc,(void *)val);
    THREAD_ERROR_CHECK(ret,"pthread_create");

    printf("I am main thread \n" );
    sleep(1);

    return 0;
}

